//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.hoas.comparedb.mysql;

import org.thymeleaf.TemplateEngine;
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;

import java.io.IOException;

public class TemplateHelper {

    private static TemplateEngine templateEngine;


    public static synchronized TemplateEngine getTemplateEngine() throws IOException {

        if (templateEngine == null) {

            //构造模板引擎
            ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();
            resolver.setPrefix("template/");//模板所在目录，相对于当前classloader的classpath。
            resolver.setSuffix(".html");//模板文件后缀
            templateEngine = new TemplateEngine();
            templateEngine.setTemplateResolver(resolver);
        }

        return templateEngine;

    }


}
